﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/*
    2012-2-17 David检查正常
 */
namespace BenefitHelper.Sys
{
    /// <summary>
    /// 小组，组长关系，这个应该来通过网页手动操作
    /// </summary>
    public class GroupMaster
    {
        /// <summary>
        /// 编号
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 小组编号
        /// </summary>
        public int GroupId { get; set; }
        /// <summary>
        /// 小组
        /// </summary>
        public virtual Groups Group { get; set; }
        /// <summary>
        /// 操作员编号
        /// </summary>
        public int MasterId { get; set; }
        /// <summary>
        /// 操作员
        /// </summary>
        public virtual Operator Master { get; set; }

        public List<BenefitHelper.Sys.GroupMaster> GetGroupMasterId(int groupid, DB.DBManager db)
        {
            var query = db.GroupMaster.Where(a => a.GroupId == groupid);
            return query.ToList();
        }

        public List<BenefitHelper.Sys.GroupMaster> GetList(DB.DBManager db)
        {
            var query = db.GroupMaster.ToList();
            return query;
        }

        public void Insert(DB.DBManager db, GroupMaster gm)
        {
            db.GroupMaster.Add(gm);
            db.SaveChanges();
        }
    }
}